package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Strategy;
import cn.wolfcode.trip.base.query.CommentQueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StrategyMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Strategy record);

    Strategy selectByPrimaryKey(Long id);

    List<Strategy> selectAll(@Param("state") Integer state);

    int updateByPrimaryKey(Strategy record);

    List<Strategy> selectForList(QueryObject qo);



    int selectLoveForId(Long typeId);

    void updateLove(@Param("typeId") Long typeId, @Param("loveNum") int loveNum);

    List<Strategy> selectByCollectId(List<Integer> collectIds);

    int selectCollectNum(Long collectId);

    void updateCollectNum(@Param("collectId") Long collectId, @Param("collectNum") int collectNum);

    List<String> listTitleAndSubTitle();

    /**
     * 获取攻略下的评论总条数
     * @param userId
     * @return
     */
    Integer getUserComment(Long userId);

}